<?php echo $this->Html->script(array('rating/jquery.rating.js'),array('inline'=>false)) ?>
<?php echo $this->Html->css(array('rating/jquery.rating'),'stylesheet',array('inline'=>false)) ?>
<div class="span8">
	<div class="form-wrap">
		<div class="toolbar-box">
			<div class="toolbar-title left">
				<h3>
				<?php echo __('View Article'); ?>
				</h3>
			</div>
			<div class="toolbar-btn right">
				<a href="<?php echo $this->Html->url(array('action'=>'index')) ?>"
					class="btn btn-small"><i class="icon-circle-arrow-left"></i>&nbsp;<?php echo __('Back') ?>
				</a> <a
					href="<?php echo $this->Html->url(array('controller'=> 'articles', 'action'=>'duplicate', $this->data['Article']['id'])) ?>"
					class="btn btn-small btn-primary"><i
					class="icon-ok-sign icon-white"></i>&nbsp;<?php echo __('Duplicate') ?>
				</a>
			</div>
			<div class="clearfix"></div>
		</div>
		<h3>
		<?php echo $this->data['Category']['title'] ?>
			: <abbr><?php echo $this->data['Article']['title'] ?> </abbr>
		</h3>
		<div class="article-content">
			<div class="well well-small">
			<?php echo $this->data['Article']['content']?>
			</div>
		</div>

		<div>
		<?php echo __('Keywords')." : ".implode(' , ',explode(",", $this->data['Article']['keyword']))?>
		</div>
		<div>
		<?php echo __('Tags')." : ".implode(' , ',explode(",", $this->data['Article']['tag']))?>
		</div>
	</div>
</div>

<div class="span4 well well-small">
<?php if(!empty($this->data['Check'])): ?>
<?php foreach($this->data['Check'] as $comment): ?>
	<div id="comment-list">
		<blockquote>
			<p>
			<?php echo $comment['comment'] ?>
			</p>
			<small><?php echo __(sprintf('Comment by %s at %s',$comment['User']['username'],
			date('d/m/Y H:i',strtotime($comment['created']))),true) ?> </small>
		</blockquote>
	</div>
	<?php endforeach; ?>
	<?php endif; ?>

	<?php echo $this->Form->create('Article', array('class'=> 'form-horizontal'))?>
	<div>
		<label class="control-label"><?php echo __('Check')." :" ?> </label>
		<div class="controls">
		<?php $status = array(ARTICLE_STATUS_ACCEPTED => __('Accept'), ARTICLE_STATUS_REJECTED => __('Reject'), ARTICLE_STATUS_BLOCKED=> __('Block'))?>
			<div class="radio">
			<?php
			echo $this->Form->radio('status', $status, array(
					'legend' => false,
					'div' => false,
					'value' => $this->data['Article']['status'],
			));
			?>
			</div>
		</div>
	</div>
	<div>
		<label class="control-label"><?php echo __('Rating')." :" ?> </label>
		<div class="controls">
		<?php
		$ratings = array();
		for($i=0; $i<10; $i++){
			$ratings[$i+1] = $i+1;
		}
		echo $this->Form->select('rating',$ratings, $this->data['Article']['rating'], array('class'=> 'rating'));
		?>
			<div class="clear"></div>
		</div>
	</div>
	<div class="row-fluid">
		<textarea class="span12" style="margin: 10px 0 10px;" rows="4"
			name="data[Article][comment]"
			placeholder="<?php echo __('Write a comment') ?>"
			autocomplete="off"></textarea>
	</div>
	<button type="submit" class="btn btn-primary">
	<?php echo __('Save') ?>
	</button>
	<?php echo $this->Form->end(); ?>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$(".rating").rating({showCancel: false});
	$(".collapse").collapse();
});
</script>
</div>







